package com.lxd.milktea.service.impl;

import com.lxd.milktea.dao.StockInfoRepository;
import com.lxd.milktea.dataobject.StockInfo;
import com.lxd.milktea.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ProjectName: milktea
 * @Package: com.lxd.milktea.service.impl
 * @ClassName: StockServiceImpl
 * @Author: carrymaniac
 * @Description:
 * @Date: 2020/5/12 12:43 下午
 * @Version:
 */
@Service
public class StockServiceImpl implements StockService {

    final
    StockInfoRepository stockInfoRepository;

    public StockServiceImpl(StockInfoRepository stockInfoRepository) {
        this.stockInfoRepository = stockInfoRepository;
    }

    @Override
    public StockInfo addStock(StockInfo info) {
        return stockInfoRepository.save(info);
    }

    @Override
    public void delStock(String id)
    {
        stockInfoRepository.deleteById(id);
    }
}
